<template>
    <section class="popup-drug__detail">
        <div class="detail__head">
            <div class="head__avatar">
                <the-image-viewer :has-view="false" width="140px" height="140px" :url="detail.drugImg"></the-image-viewer>
            </div>
            <div class="head__info">
                <div class="info__title">
                    {{ isHisByLj ? detail.drugName :
                        isYiBaoByZh ? detail.name : detail.drugName }}
                </div>
                <div class="info__row">
                    规格：
                    {{ isHisByLj ? detail.packageSpec : 
                        isYiBaoByZh ?  detail.norms : detail.drugSpecifications }}
                </div>
                <div class="info__row">
                    参考价格：
                    {{ isHisByLj ? detail.retailPrice :  detail.drugPrice }}
                </div>
            </div>
        </div>
        <div class="detail__body">
            <div class="detail__box">
                <div class="box__item">别名：{{detail.alias}}</div>
                <div class="box__item">
                    通用名：
                    {{ isHisByLj ? detail.drugCommonName : detail.commonName}}
                </div>
                <div class="box__item">
                    产地：
                    {{ isHisByLj ? detail.productionPlace : detail.drugOrigin}}
                </div>
                <div class="box__item">
                    药品类型：
                    <span v-if="isHisByLj">{{ detail.typeName || '' }}</span>
                    <span v-else-if="isYiBaoByZh">{{ detail.type || '' }}</span>
                    <span v-else>{{ detail.drugType == 1 ? '中药': '西药'}}</span>
                </div>

                <div class="box__item">
                    来源：
                    {{ isHisByLj ? '院内药房' : detail.storeName }}
                </div>
                <div class="box__item">
                    厂商：
                    {{ isHisByLj ? detail.manufactorName : 
                        isYiBaoByZh ? detail.manufacturer : detail.drugCompany }}
                </div>
            </div>
            <div class="detail__other">
                <span>{{detail.drugInstructions || '暂无药品说明详情'}}</span>
            </div>
        </div>
    </section>
</template>

<script>
    export default {
        props: {
            paymentId: [String, Number], //付费方式id
            detail: {
                type: Object,
                default: () => {}
            } // 药品详情
        },
        data() {
            return {
                // isHis: false, // 是否廉江His院内
                // isZhYiBao: false, // 是否珠海医保
            }
        },
        computed: {
            isHisByLj() {
                return this.$global.platform('lj') && (!this.detail.storeId || this.detail.storeId == '0')
            },
            isYiBaoByZh() {
                return this.$global.platform('zh') && this.paymentId == 2;
            }
        }
    }
</script>

<style></style>